using NUnit.Framework;
using SQLLog4net.Log;
using SQLTests.Framework;

namespace SQLTests.Log4net.Log
{
	/// <summary>
	/// Summary description for Class1.
	/// </summary>
	public class PathTests:
		AbstractTest
	{
		private PathItem _pathItem;

		public PathTests():base(){}


		[TestFixtureSetUp]
		protected override void SetUpFixtures()
		{
			_pathItem = new PathItem("First Node", null);
		}

		[Test]
		public void AddNextNode()
		{
			_pathItem.NextNode = new PathItem("Second Node", _pathItem);
			Assert.AreEqual(_pathItem.NextNode.Name, "Second Node");
		}

		[Test]
		public void AddTwoNodes()
		{
			_pathItem.NextNode = new PathItem("Second Node", _pathItem);
			PathItem thirdNode = new PathItem("Third Node", _pathItem.NextNode);
			Assert.AreEqual(_pathItem.NextNode.NextNode.Name, "Third Node");
			Assert.AreEqual(thirdNode.FirstNode().Name, "First Node");
		}

		[Test]
		public void CheckPath()
		{
			_pathItem.NextNode = new PathItem("Second Node", _pathItem);
			PathItem thirdNode = new PathItem("Third Node", _pathItem.NextNode);
			Assert.AreEqual(thirdNode.FullPath(), @"First Node\Second Node\Third Node");
			
		}
	}
}
